import type { AddressItem } from '@/types/address'
import { defineStore } from 'pinia'
import { ref } from 'vue'

// 定义 Store
export const useAddressStore = defineStore('address', () => {
  const selectedAddress = ref<AddressItem>()

  const setSelectedAddress = (item: AddressItem) => {
    selectedAddress.value = item
  }

  return {
    selectedAddress,
    setSelectedAddress,
  }
})
